IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'CreatorGetByLogin')
	BEGIN
		DROP  Procedure  CreatorGetByLogin
	END

GO

CREATE Procedure [dbo].[CreatorGetByLogin]
(
	 @CovenantID int,
	 @UserName nvarchar(50),
	 @Password nvarchar(50) 
)
AS

SELECT     Creator.CreatorID, Creator.Name, Creator.DefaultAccess, Creator.CanAdd, 
                      Covenant.TemplateStyle, Covenant.CovenantID
FROM         Creator INNER JOIN
                      Covenant ON Creator.CovenantID = Covenant.CovenantID

WHERE     (Covenant.CovenantID = @CovenantID) AND (UserName = @UserName) AND (Password = @Password)

